//
//  QLNewPersonalHomeVC.m
//  神约
//
//  Created by qlwl on 16/12/29.
//  Copyright © 2016年 qlwl. All rights reserved.
//

#import "QLNewPersonalHomeVC.h"
#import "QLNewPersonalHomeCell.h"
#import "UIView+FrameKIt.h"

@interface QLNewPersonalHomeVC ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation QLNewPersonalHomeVC
{
    float _cellHeight_1;
    float _cellHeight_8;
    float _cellHeight_9;
    float _cellHeight_2;
    float _cellHeight_3;
    float _cellHeight_4;
    float _cellHeight_5;
    float _cellHeight_6;
    float _cellHeight_7;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _cellHeight_1 = 1;
    _cellHeight_2 = 1;
    _cellHeight_3 = 1;
    _cellHeight_4 = 1;
    _cellHeight_5 = 1;
    _cellHeight_6 = 1;
    _cellHeight_7 = 1;
    _cellHeight_8 = 1;
    _cellHeight_9 = 1;
    [self.navigationController setNavigationBarHidden:YES animated:NO];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}


#pragma mark TabDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        QLNewPersonalPhotoCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalPhotoCell"];
        cell.titleLab.text = @"个人相册";
        cell.maxLineNum = 2;
        cell.imaArray = @[@"",@"",@"",@"",@"",@""];
        _cellHeight_1 = cell.f_height;
        return cell;
    }else if (indexPath.section == 1){
        QLNewPersonalPhotoCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalPhotoCell"];
        cell.titleLab.text = @"视频相册";
        cell.maxLineNum = 1;
        cell.imaArray = @[@"",@"",@"",@"",@"",@""];
        _cellHeight_8 = cell.f_height;
        return cell;
    }else if (indexPath.section == 2){
        QLNewPersonalPhotoCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalPhotoCell"];
        cell.titleLab.text = @"秘密相册";
        cell.maxLineNum = 1;
        cell.imaArray = @[@"",@"",@"",@"",@"",@""];
        _cellHeight_9 = cell.f_height;
        return cell;
    }else if (indexPath.section == 3){
        QLNewPersonalDynamicCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalDynamicCell"];
        _cellHeight_3 = cell.f_height;
        return cell;
    }else if (indexPath.section == 4){
        QLNewPersonalLoveCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalLoveCell"];
        return cell;
    }else if (indexPath.section == 5){
        QLNewPersonalInvitedCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalInvitedCell"];
        cell.itemArray = @[@"",@"",@"",@""];
        _cellHeight_2 = cell.f_height;
        return cell;
    }else if (indexPath.section == 6){
        QLNewPersonalDynamicIdentifCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalDynamicIdentifCell"];
        _cellHeight_4 = cell.f_height;
        return cell;
    }else if (indexPath.section == 7){
        QLNewPersonalAboutTaCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalAboutTaCell"];
        cell.dataArray1 = @[@"美腿",@"小语种",@"美腿",@"小语种",@"美腿",@"没胸",@"哈哈",@"呵呵"];
        cell.dataArray2 = @[@"小语种"];
        cell.dataArray3 = @[@"哈哈"];
        _cellHeight_5 = cell.f_height;
        return cell;
    }else if (indexPath.section == 8){
        QLNewPersonalGiftCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLNewPersonalGiftCell"];
        cell.maxItemNum = 12;
        cell.imaArray = @[@"",@""];
        _cellHeight_6 = cell.f_height;
        return cell;
    }else if (indexPath.section == 9){
        static NSString * cellName = @"ImpressCell";
        QLNewPersonalImpressCell * cell = [tableView dequeueReusableCellWithIdentifier:cellName];
        if (cell == nil) {
            cell = [[QLNewPersonalImpressCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellName];
        }
        cell.titLab.text = @"Ta人印象";
        cell.itemArray = @[@"美腿",@"小语种",@"美腿",@"小语种",@"美腿",@"没胸",@"哈哈",@"呵呵"];
        _cellHeight_7 = cell.f_height;
        return cell;
    }
    return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        
        return _cellHeight_1;
    }else if (indexPath.section == 1){
        
        return _cellHeight_8;
    }else if (indexPath.section == 2){
        
        return _cellHeight_9;
    }else if (indexPath.section == 3){
        
        return _cellHeight_3;
    }else if (indexPath.section == 4){
        
        return 62;
    }else if (indexPath.section == 5){
        
        return _cellHeight_2;
    }else if (indexPath.section == 6){
        
        return _cellHeight_4;
    }else if (indexPath.section == 7){
        
        return _cellHeight_5;
    }else if (indexPath.section == 8){
        return _cellHeight_6;
    }else if (indexPath.section == 9){
        return _cellHeight_7;
    }
    return 0;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return .5f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 6.0f;
}




@end
